<template name="college">
	<view class="bgf5">
		<view class="image-box" :style='"background:url("+posterImg.carouselImage+") no-repeat;width:750upx;height:100vmax;background-size: 100% 100%;"' @click="goodsClick()"></view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				posterImg:{},
				appId:'',
			}
		},
        onTabItemTap(item){
           this.goBsyShop();
		   this.getPosterImg();
        },
		onLoad() {
            //跳转到商城的首页
           this.goBsyShop();
		   this.getPosterImg();
          
			
		},
		onShow() {
			console.warn('test', global)
            this.goBsyShop();
			this.getPosterImg();
		},
	
        
		methods: {
			getPosterImg() {
				this.$https.get(global.apiUrls.getPosterImg, {}).then(res => {
					if (res.data.result) {
						this.posterImg = res.data.result;
						this.appId = res.data.result.carouselUrl;
					}
				})
			},
			goodsClick(){
				this.goBsyShop()
			},
            //跳转的商城小程序
            goBsyShop(){
                if(global.IS_BSY_SHOP){
                    wx.navigateToMiniProgram({
                        appId: this.appId,
                        // appId: 'wx3cc80cbbb6a3b5f9',
                        path: 'pages/home/home',
                        envVersion: global.IS_DEV?'trial':'release',
                        fail: function(res) {   
                          console.info(res,"res取消")
                          // wx.reLaunch({url: "/pages/tab/home"});//选择取消后，relaunch 到首页，否则会显示空白页面
                            wx.navigateBack({
                              delta : 1,
                            })
                        }
                    });
                }
            },
			
		}
	}
</script>

<style lang="scss">
	
	// .image-box{
	// 	width: 750upx;
	// 	height: 100vmax;
	// 	background: url(https://static.bsyjk.cn/newoss2/D4DAC37593394D66A555E3837DB88F43.png);
	// 	background-size: 100% 100%;
		
	// }
	
</style>
